package com.example.erp.controller;

import com.example.erp.service.FileService;
import com.example.erp.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping("/api/v1/admin/file")
public class FileController {
    @Autowired
    FileService fileService;
    /**
     * 用户头像上传
     * */
    @PostMapping("/user/uploadPic")
    public Result userUploadPic(MultipartFile file) throws IOException {
        return fileService.uploadPic(file,"user/");
    }
}